package com.wxy.ej.flow.modules.act.listen;

import lombok.extern.slf4j.Slf4j;
import org.activiti.bpmn.model.FlowElement;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * 任务调用前，根据规则编号，创建业务系统部门任务和人员，同时返回部门和人员信息。
 * 子流程调用了4次（4个机构）
 * 1001
 * [1001, 1002, 1003, 1004]
 */
@Slf4j
@Component("testListener")
@Scope("prototype")
public class TestListener implements ExecutionListener {

    @Override
    public void notify(DelegateExecution delegateExecution) {
        FlowElement flowElement = delegateExecution.getCurrentFlowElement();
        System.out.println("test flowElementName: "+flowElement.getName());
    }


}
